/*     */ package com.zimbra.cs.util;
/*     */ 
/*     */ import com.zimbra.common.localconfig.KnownKey;
/*     */ import com.zimbra.common.localconfig.LC;
/*     */ import com.zimbra.common.util.ByteUtil;
/*     */ import java.io.BufferedReader;
/*     */ import java.io.File;
/*     */ import java.io.FileReader;
/*     */ import java.io.IOException;
/*     */ import java.io.PrintStream;
/*     */ import java.lang.reflect.Field;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public final class BuildInfo
/*     */ {
/*     */   public static final String VERSION;
/*     */   public static final String TYPE;
/*     */   public static final String RELEASE;
/*     */   public static final String DATE;
/*     */   public static final String HOST;
/*     */   public static final String PLATFORM;
/*     */   public static final String MAJORVERSION;
/*     */   public static final String MINORVERSION;
/*     */   public static final String MICROVERSION;
/*     */   public static final String BUILDNUM;
/*     */   public static final String FULL_VERSION;
/*     */   
/*     */   static
/*     */   {
/*  45 */     String version = "unknown";
/*  46 */     String type = "unknown";
/*  47 */     String release = "unknown";
/*  48 */     String date = "unknown";
/*  49 */     String host = "unknown";
/*  50 */     String majorversion = "unknown";
/*  51 */     String minorversion = "unknown";
/*  52 */     String microversion = "unknown";
/*  53 */     String platform = getPlatform();
/*  54 */     String buildnum = "buildnum";
/*     */     try {
/*  56 */       Class<?> clz = Class.forName("com.zimbra.cs.util.BuildInfoGenerated");
/*  57 */       version = (String)clz.getField("VERSION").get(null);
/*  58 */       type = (String)clz.getField("TYPE").get(null);
/*  59 */       release = (String)clz.getField("RELEASE").get(null);
/*  60 */       date = (String)clz.getField("DATE").get(null);
/*  61 */       host = (String)clz.getField("HOST").get(null);
/*  62 */       majorversion = (String)clz.getField("MAJORVERSION").get(null);
/*  63 */       minorversion = (String)clz.getField("MINORVERSION").get(null);
/*  64 */       microversion = (String)clz.getField("MICROVERSION").get(null);
/*  65 */       buildnum = (String)clz.getField("BUILDNUM").get(null);
/*     */     } catch (Throwable e) {
/*  67 */       System.out.println("build information not available: " + e);
/*     */     }
/*     */     
/*  70 */     VERSION = version;
/*  71 */     TYPE = type;
/*  72 */     RELEASE = release;
/*  73 */     DATE = date;
/*  74 */     HOST = host;
/*  75 */     PLATFORM = platform;
/*  76 */     MAJORVERSION = majorversion;
/*  77 */     MINORVERSION = minorversion;
/*  78 */     MICROVERSION = microversion;
/*  79 */     BUILDNUM = buildnum;
/*  80 */     if ((TYPE != null) && (TYPE.length() > 0))
/*     */     {
/*  82 */       FULL_VERSION = VERSION + " " + RELEASE + " " + DATE + " " + TYPE;
/*     */     } else {
/*  84 */       FULL_VERSION = VERSION + " " + RELEASE + " " + DATE;
/*     */     }
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   private static String getPlatform()
/*     */   {
/*  93 */     String platform = "unknown";
/*  94 */     File platformFile = new File(LC.zimbra_home.value(), ".platform");
/*  95 */     if (platformFile.exists()) {
/*  96 */       BufferedReader reader = null;
/*     */       try {
/*  98 */         reader = new BufferedReader(new FileReader(platformFile));
/*  99 */         String line = null;
/* 100 */         while ((line = reader.readLine()) != null) {
/* 101 */           if (line.length() > 0) {
/* 102 */             platform = line;
/*     */           }
/*     */         }
/*     */       }
/*     */       catch (IOException e) {
/* 107 */         System.err.println("Unable to determine platform.");
/* 108 */         e.printStackTrace(System.err);
/*     */       } finally {
/* 110 */         ByteUtil.closeReader(reader);
/*     */       }
/*     */     } else {
/* 113 */       System.err.format("Unable to determine platform because %s does not exist.\n", new Object[] { platformFile });
/*     */     }
/* 115 */     return platform;
/*     */   }
/*     */   
/*     */   public static void main(String[] args) {
/* 119 */     System.out.println("Version: " + VERSION);
/* 120 */     System.out.println("Release: " + RELEASE);
/* 121 */     System.out.println("Build Date: " + DATE);
/* 122 */     System.out.println("Build Host: " + HOST);
/* 123 */     System.out.println("Full Version: " + FULL_VERSION);
/* 124 */     System.out.println("DB Version: 103");
/* 125 */     System.out.println("Index Version: 2");
/*     */   }
/*     */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/util/BuildInfo.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */